﻿using System;
using BestCode.Creds.Data.MapHelper;
using BestCode.Creds.Entities;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NHibernate.Criterion;
using  System.Linq;

namespace BestCode.Creds.Test
{
    [TestClass]
    public class EntityInfoTest
    {
        [TestMethod]
        public void SaveEntityInfoTest()
        {
            var session = SessionFactoryBuilder.BuildSessionFactory().OpenSession();

            Template template = new Template();
            template.Code = "CODE";
            template.Name = "NAME";
            template.FaceImagePath = "DATATTTTT";
            session.Save(template);


            EntityInfo info = new EntityInfo();
            info.Code = "ETCODE";
            info.Name = "ETNAME";
            info.AnverseFace = template;
            info.ReverseFace = template;
            session.Save(info);

            Assert.IsNotNull(template.Id!=0);

        }
    }
}
